/**
 * 
 */
package com.surelution.core;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * @author <a href="mailto:guangzong.syu@gmail.com">Guangzong</a>
 *
 */
public class SystemInfo implements Serializable {

	private static final long serialVersionUID = 3660526913604946784L;

	private String companyName;
	private Date from;
	private Date to;
	
	private Set<String> wands;
	private Set<String> poiSns;
	
	public SystemInfo(String companyName, Date from, Date to, Set<String> wands, Set<String> poiSns) {
		this.companyName = companyName;
		this.from = from;
		this.to = to;
		
		this.wands = new HashSet<String>();
		for(String wand : wands) {
			this.wands.add(wand);
		}

		this.poiSns = new HashSet<String>();
		for(String poiSn : poiSns) {
			this.poiSns.add(poiSn);
		}
	}
	
	public String getCompanyName() {
		return companyName;
	}
	public Date getFrom() {
		return from;
	}
	public Date getTo() {
		return to;
	}
	
	public boolean poiContains(String sn) {
		return poiSns.contains(sn);
	}
	
	public boolean wandContains(String sn) {
		return wands.contains(sn);
	}
	
	public String[] getWandsSn() {
		String[] wandsSn = new String[wands.size()];
		wands.toArray(wandsSn);
		return wandsSn;
	}
	
	public String[] getPoisSn() {
		String[] poisSn = new String[poiSns.size()];
		poiSns.toArray(poisSn);
		return poisSn;
	}
}
